package com.fjwt.gz.core.constants;

/*
* 接口返回码
*
* @author wg
* @site https://pt.jdyd.xyz/
* @date 2021/5/24 17:07
*/
public enum ApiCodeEnum{

    SUCCESS(0, "SUCCESS"), //请求成功

    CUSTOM_FAIL(9999, "自定义业务异常[%s]"),  //自定义业务异常

    SYSTEM_ERROR(10, "系统异常[%s]"),
    PARAMS_ERROR(11, "参数有误[%s]"),
    DB_ERROR(12, "数据库服务异常"),

    SYS_OPERATION_FAIL_CREATE(5000, "新增失败"),
    SYS_OPERATION_FAIL_DELETE(5001, "删除失败"),
    SYS_OPERATION_FAIL_UPDATE(5002, "修改失败"),
    SYS_OPERATION_FAIL_SELETE(5003, "记录不存在"),
    SYS_PERMISSION_ERROR(5004, "权限错误，当前用户不支持此操作"),
    SYS_USER_PWD_EXPIRED(5005, "用户密码已过期，请更改"),
    SYS_WXCOUPON_SUCCESS_NOTIFY(200, "微信卡券异步回调通知处理成功！"),
    SYS_WXCOUPON_FAIL_NOTIFY(500, "微信卡券异步回调通知处理失败！"),
    SYS_TLPAY_SUCCESS_COUPON_NOTIFY(10000, "卡券异步回调通知处理成功"),
    SYS_TLPAY_FAIL_COUPON_NOTIFY(500, "卡券异步回调通知处理失败！"),
    SYS_NEED_UPDATE_PWD(5006, "请修改密码！"),

//  小程序错误码---4开头，5位
    LITE_USER_INFO_ERROR(40001,"%s"),
    LITE_LOGIN_ERROR(401,"%s"),
    LITE_USER_ERROR(40003,"用户不存在！"),
    LITE_USER_SUBJECT_OFFICIAL_ERROR(40005,"%s"),//同主体发券未授权
    LITE_USER_NO_OFFICIAL_ERROR(40002,"%s"),//用户未关注地域公众号
    LITE_USER_REPEAT_RECORD(40006,"您已兑换成功，是否需要再次兑换？"),
    LITE_USER_COUPON(40004,"%s");// 抢券排队中错误码

    private int code;

    private String msg;

    ApiCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode(){
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }
}
